<?php
/**
 * class FeedModel
 * модель для страницы новостная лента 
 */
class FeedModel extends Model{
    public function __construct() {
        parent::__construct();
    }
    
     /**
     * 
     * @return type 
     */
    public function getGroupNews() {
         $data = $this->db->query("SELECT *, DATE_FORMAT(FROM_UNIXTIME(date), '<span class=\"year\">%d.%m.%y</span> <b>%H:%I</b>') as n_date, count(*) as num FROM feed GROUP BY (date DIV 60) HAVING who");
         return $data->rows;
    } 
    
    /**
     * Возвращает все новости из БД
     * @return type 
     */
    public function getAllNews() {
         $data = $this->db->query("SELECT * FROM feed");
         return $data->rows;
    }
}
?>